package com.ljt.framework.test;

import org.junit.Test;

import com.ljt.framework.test.demo.StaticUserService;
import com.ljt.framework.test.demo.UserAction;

import mockit.NonStrictExpectations;
import mockit.Verifications;

public class JMockForPublicStaticDemo {
	
	@Test
	public void test(){
		
		new NonStrictExpectations(StaticUserService.class) {
            {
                StaticUserService.sayHello(anyString);
                result = "mock";
            }
        };

//      Assert.assertEquals("mock", StaticUserService.sayHello("real"));
        UserAction userAction = new UserAction();
        userAction.executeForPublicStatic1("real");

        new Verifications() {
            {
                StaticUserService.sayHello(anyString);
                times = 1;
            }
        };
        
        StaticUserService.sayHello("real");
    }

}
